<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('wx用户列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>

                            <li>
                                <label>微信昵称：</label>
                                <input type="text" name="wxUserName"/>
                            </li>

                            <li>
                                <label>注册手机号：</label>
                                <input type="text" name="redistPhone"/>
                            </li>
                            <li>
                                <label>真实姓名：</label>
                                <input type="text" name="realname"/>
                            </li>

                            <li>
                                <label>性别 0=女 1=男：</label>
                                <select name="sex">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>账号状态 1=登录 0退出 2未登录：</label>
                                <input type="text" name="state"/>
                            </li>
                            <li>
                                <label>户籍所在地(0越城区,1柯桥区 ,2上虞区 ,3嵊州市, 4诸暨市,5新昌县 ,6其他 )：</label>
                                <input type="text" name="householdRegister"/>
                            </li>
                            <li>
                                <label>专业领域：</label>
                                <input type="text" name="industry"/>
                            </li>
                            <li>
                                <label>审核状态 0=未审核 1=审核中 2=审核通过 ，3审核未通过：</label>
                                <input type="text" name="shenhe"/>
                            </li>
                            <li>
                                <label>状态(个人名片信息是否公开 0私密 1公开：</label>
                                <input type="text" name="privateDetailed"/>
                            </li>
                            <li>
                                <label>会员状态 0=不是会员 1会员：</label>
                                <input type="text" name="member"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="wx_userAndShenhe:user:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="wx_userAndShenhe:user:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wx_userAndShenhe:user:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="wx_userAndShenhe:user:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('wx_userAndShenhe:user:edit')}]];
        var removeFlag = [[${@permission.hasPermi('wx_userAndShenhe:user:remove')}]];
        var shenheFlag = [[${@permission.hasPermi('wx_userAndShenhe:user:shenhe')}]];
        var prefix = ctx + "wx_userAndShenhe/user";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                updateUrl: prefix + "/shenhe/{id}",
                modalName: "wx用户",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '用户主键',
                    visible: false
                },
                {
                    field: 'wxUserName',
                    title: '微信昵称'
                },
                {
                    field: 'redistPhone',
                    title: '注册手机号'
                },
                {
                    field: 'realname',
                    title: '真实姓名'
                },
                {
                    field: 'sex',
                    title: '性别 0=女 1=男'
                },
                {
                    field: 'state',
                    title: '账号状态 1=登录 0退出 2未登录'
                },
                {
                    field: 'householdRegister',
                    title: '户籍所在地(0越城区,1柯桥区 ,2上虞区 ,3嵊州市, 4诸暨市,5新昌县 ,6其他 )'
                },
                {
                    field: 'industry',
                    title: '专业领域'
                },
                {
                    field: 'shenhe',
                    title: '审核状态 0=未审核 1=审核中 2=审核通过 ，3审核未通过'
                },
                {
                    field: 'privateDetailed',
                    title: '状态(个人名片信息是否公开 0私密 1公开'
                },
                {
                    field: 'member',
                    title: '会员状态 0=不是会员 1会员'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + shenheFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>